{% include 'base.html' %}

<style>
    .form-container {
        max-width: 600px;
        margin: 30px auto;
        background: white;
        padding: 25px;
        border-radius: 8px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }

    .form-title {
        font-size: 22px;
        margin-bottom: 25px;
        color: #2c3e50;
    }

    .form-group {
        margin-bottom: 20px;
    }

    .form-group label {
        display: block;
        margin-bottom: 8px;
        font-weight: 500;
        color: #444;
    }

    .form-control {
        width: 100%;
        padding: 10px 12px;
        border: 1px solid #ddd;
        border-radius: 4px;
        font-size: 16px;
        transition: border-color 0.3s;
    }

    .form-control:focus {
        border-color: #3498db;
        outline: none;
        box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
    }

    .current-photo {
        max-width: 200px;
        margin: 10px 0;
        border-radius: 4px;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }

    .btn-submit {
        background-color: #3498db;
        color: white;
        border: none;
        padding: 12px 20px;
        border-radius: 4px;
        font-size: 16px;
        cursor: pointer;
        transition: background-color 0.3s;
    }

    .btn-submit:hover {
        background-color: #2980b9;
    }
</style>

<div class="form-container">
    <h1 class="form-title">修改{{smodel_type_name}}信息</h1>
    <form method="post" enctype="multipart/form-data">
        <div class="form-group">
            <label for="name">名字</label>
            <input type="text" name="name" id="name" class="form-control" value="{{smodel.name}}" required>
        </div>
        <div class="form-group">
            <label for="file">图片</label>
            {% if smodel.photo_path %}
            <img src="{{ url_for('static', filename=smodel.photo_path) }}" alt="当前照片" class="current-photo">
            {% endif %}
            <input type="file" name="file" id="file" accept="image/*" class="form-control">
        </div>
        <div class="form-group">
            <label for="jian_jie">简介</label>
            <input type="text" name="jian_jie" id="jian_jie" class="form-control" value="{{smodel.jian_jie}}" required>
        </div>
        <div class="form-group">
            <input type="submit" value="上传" class="btn-submit">
        </div>
    </form>
</div>